home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / clipper / nftroff.zip / 5.tr < prev    next >
Text File  |  1991-11-21  |  53KB  |  3,238 lines

  1. .de }n
  2. .bp
  3. .sp .5i
  4. ..
  5. .wh -.8i }n
  6. .sp .5i
  7. .po -.4i
  8. .ll 7.5i
  9. .ps 9
  10. .vs 9
  11. .in 0i
  12. .ta 1.63265i
  13. .sp 2
  14. .ne 20
  15. .ps +3
  16. .vs +3
  17. FT_ACCTADJ()    Adjust beginning or ending fiscal pd\. dates to acctg\. dates
  18. .br
  19. .ta
  20. .in 0.08i
  21. .ps -3
  22. .vs -3
  23. .sp 2
  24. \fBFT_ACCTADJ()
  25. Adjust beginning or ending fiscal pd\. dates to acctg\. dates
  26. .in 0i
  27. .br
  28. \l'6.24i'
  29. .br
  30. .sp
  31. .in 0.08i
  32. \fBSyntax
  33. .sp
  34. .in 0.4i
  35. \fBFT_ACCTADJ( [ <dGivenDate> ], [ <lIsEnd> ] ) -> dDate
  36. .sp
  37. .in 0.08i
  38. \fBArguments
  39. .sp
  40. .in 0.4i
  41. \fB<dGivenDate>\fR is any valid date in any valid format\.
  42. Defaults to DATE() if not supplied\.
  43. .sp
  44. \fB<lIsEnd>\fR is a logical variable\. \.F\. = adjust for beginning of
  45. period mode, \.T\. = adjust for end of period mode\.  Defaults to
  46. beginning of period mode\.
  47. .sp
  48. .in 0.08i
  49. \fBReturns
  50. .sp
  51. .in 0.4i
  52. An adjusted date dependent upon mode and work week start day\.
  53. .sp
  54. .in 0.08i
  55. \fBDescription
  56. .sp
  57. .in 0.4i
  58. Called by other FT_ACCT\.\. functions\. The algorithm is:
  59. .sp
  60. Beginning of period mode:
  61. .sp
  62. .in 0.64i
  63. If dGivenDate is in last 3 days of work week
  64. .in 0.88i
  65. Return next week\'s start date
  66. .in 0.64i
  67. Else
  68. .in 0.88i
  69. Return this week\'s start date
  70. .in 0.64i
  71. Endif
  72. .sp
  73. .in 0.4i
  74. End of period mode:
  75. .sp
  76. .in 0.64i
  77. If dGivenDate is in last 4 days of work week
  78. .in 0.88i
  79. Return this week\'s end date
  80. .in 0.64i
  81. Else
  82. .in 0.88i
  83. Return prior week\'s end date
  84. .in 0.64i
  85. Endif
  86. .sp
  87. .in 0.08i
  88. \fBExamples
  89. .sp
  90. .in 0.4i
  91. Beginning of period mode (lIsEnd == \.F\.)
  92. .sp
  93. .in 0.56i
  94. .ta 2.32i
  95. dDate := Ctod( "01/31/91" )    // In last 3 days of work week
  96. .br
  97. .ta
  98. .ta 2.32i
  99. ? FT_ACCTADJ( dDate )    // 02/03/91 (next week\'s start)
  100. .br
  101. .ta
  102. .sp
  103. .ta 2.32i
  104. dDate := Ctod( "03/31/91" )    // Not in last 3 days of work week
  105. .br
  106. .ta
  107. .ta 2.32i
  108. ? FT_ACCTADJ( dDate )    // 03/31/91 (this week\'s start)
  109. .br
  110. .ta
  111. .sp
  112. .in 0.4i
  113. End of period mode (lIsEnd == \.T\.)
  114. .sp
  115. .in 0.56i
  116. .ta 2.32i
  117. dDate := Ctod( "01/31/91" )    // In last 4 days of work week
  118. .br
  119. .ta
  120. .ta 2.32i
  121. ? FT_ACCTADJ( dDate, \.T\. )    // 02/02/91 (this week\'s end)
  122. .br
  123. .ta
  124. .sp
  125. .ta 2.32i
  126. dDate := Ctod( "03/31/91" )    // Not in last 4 days of work week
  127. .br
  128. .ta
  129. .ta 2.32i
  130. ? FT_ACCTADJ( dDate, \.T\. )    // 03/30/91 (prior week\'s end)
  131. .br
  132. .ta
  133. .sp
  134. .in 0.08i
  135. \fBSource:\fR ACCTADJ\.PRG
  136. .sp
  137. \fBAuthor:\fR Jo W\. French dba Practical Computing
  138. .in 0i
  139. .sp
  140. .in 1.5i
  141. .ti -1.5i
  142. .ta 1.5i
  143. .ft B
  144. See Also:    
  145. .ft R
  146. FT_DATECNFG()
  147. , FT_DAYTOBOW()
  148. .ta 1.63265i
  149. .in 0i
  150. .sp 2
  151. .ne 20
  152. .ps +3
  153. .vs +3
  154. FT_ACCTMONTH()    Return accounting month data
  155. .br
  156. .ta
  157. .in 0.08i
  158. .ps -3
  159. .vs -3
  160. .sp 2
  161. \fBFT_ACCTMONTH()
  162. Return accounting month data
  163. .in 0i
  164. .br
  165. \l'6.24i'
  166. .br
  167. .sp
  168. .in 0.08i
  169. \fBSyntax
  170. .sp
  171. .in 0.4i
  172. \fBFT_ACCTMONTH( [ <dGivenDate> ], [ <nMonthNum> ] ) -> aDateInfo
  173. .sp
  174. .in 0.08i
  175. \fBArguments
  176. .sp
  177. .in 0.4i
  178. \fB<dGivenDate>\fR is any valid date in any date format\.  Defaults
  179. to current system date if not supplied\.
  180. .sp
  181. \fB<nMonthNum>\fR is a number from 1 to 12 signifying a month\.
  182. Defaults to current month if not supplied\.
  183. .sp
  184. .in 0.08i
  185. \fBReturns
  186. .sp
  187. .in 0.4i
  188. A three element array containing the following data:
  189. .sp
  190. .in 0.64i
  191. .br
  192. aDateInfo[1] - The year and month as a character string "YYYYMM"
  193. .br
  194. aDateInfo[2] - The beginning date of the accounting month
  195. .br
  196. aDateInfo[3] - The ending date of the accounting month
  197. .sp
  198. .in 0.08i
  199. \fBDescription
  200. .sp
  201. .in 0.4i
  202. FT_ACCTMONTH() creates an array containing data about the
  203. accounting month containing the given date\.
  204. .sp
  205. An accounting period has the following characteristics:
  206. .sp
  207. If the first week of the period contains 4 or more \'work\'
  208. days, it is included in the period; otherwise, the first
  209. week was included in the prior period\.
  210. .sp
  211. If the last week of the period contains 4 or more \'work\'
  212. days it is included in the period; otherwise, the last week
  213. is included in the next period\.  This results in 13 week
  214. \'quarters\' and 4 or 5 week \'months\'\.  Every 5 or 6 years, a
  215. \'quarter\' will contain 14 weeks and the year will contain 53
  216. weeks\.
  217. .sp
  218. .in 0.08i
  219. \fBExamples
  220. .sp
  221. .in 0.4i
  222. .br
  223. // get info about accounting month containing 9/15/90
  224. .br
  225. aDateInfo := FT_ACCTMONTH( Ctod("09/15/90") )
  226. .ta 1.36i 1.68i 2.72i
  227. .br
  228. ? aDateInfo[1]    //    199009    (9th month)
  229. .br
  230. .ta
  231. .ta 1.36i 1.68i 2.72i
  232. .br
  233. ? aDateInfo[2]    //    09/02/90    beginning of month 9
  234. .br
  235. .ta
  236. .ta 1.36i 1.68i 2.72i
  237. .br
  238. ? aDateInfo[3]    //    09/29/90    end of month 9
  239. .br
  240. .ta
  241. .sp
  242. .br
  243. // get info about accounting month 5 in year containing 9/15/90
  244. .br
  245. aDateInfo := FT_ACCTMONTH( Ctod("09/15/90"), 5 )
  246. .ta 1.36i 1.68i
  247. .br
  248. ? aDateInfo[1]    //    199005
  249. .br
  250. .ta
  251. .ta 1.36i 1.68i 2.56i
  252. .br
  253. ? aDateInfo[2]    //    04/29/89    beginning of month 5
  254. .br
  255. .ta
  256. .ta 1.36i 1.68i 2.56i
  257. .br
  258. ? aDateInfo[3]    //    06/02/90    end of month 5
  259. .br
  260. .ta
  261. .sp
  262. .in 0.08i
  263. \fBSource:\fR ACCTMNTH\.PRG
  264. .sp
  265. \fBAuthor:\fR Jo W\. French dba Practical Computing
  266. .in 0i
  267. .sp
  268. .in 1.5i
  269. .ti -1.5i
  270. .ta 1.5i
  271. .ft B
  272. See Also:    
  273. .ft R
  274. FT_DATECNFG()
  275. , FT_ACCTWEEK()
  276. , FT_ACCTQTR()
  277. , FT_ACCTYEAR()
  278. .ta 1.63265i
  279. .in 0i
  280. .sp 2
  281. .ne 20
  282. .ps +3
  283. .vs +3
  284. FT_ACCTQTR()    Return accounting quarter data
  285. .br
  286. .ta
  287. .in 0.08i
  288. .ps -3
  289. .vs -3
  290. .sp 2
  291. \fBFT_ACCTQTR()
  292. Return accounting quarter data
  293. .in 0i
  294. .br
  295. \l'6.24i'
  296. .br
  297. .sp
  298. .in 0.08i
  299. \fBSyntax
  300. .sp
  301. .in 0.4i
  302. \fBFT_ACCTQTR( [ <dGivenDate> ], [ <nQtrNum> ] ) -> aDateinfo
  303. .sp
  304. .in 0.08i
  305. \fBArguments
  306. .sp
  307. .in 0.4i
  308. \fB<dGivenDate>\fR is any valid date in any date format\.  Defaults
  309. to current system date if not supplied\.
  310. .sp
  311. \fB<nQtrNum>\fR is a number from 1 to 4 signifying a quarter\.
  312. Defaults to current quarter if not supplied\.
  313. .sp
  314. .in 0.08i
  315. \fBReturns
  316. .sp
  317. .in 0.4i
  318. A three element array containing the following data:
  319. .sp
  320. .in 0.64i
  321. .br
  322. aDateInfo[1] - The year and qtr\. as a character string "YYYYQQ"
  323. .br
  324. aDateInfo[2] - The beginning date of the accounting quarter
  325. .br
  326. aDateInfo[3] - The ending date of the accounting quarter
  327. .sp
  328. .in 0.08i
  329. \fBDescription
  330. .sp
  331. .in 0.4i
  332. FT_ACCTQTR() creates an array containing data about the
  333. accounting quarter containing the given date\.
  334. .sp
  335. An accounting period has the following characteristics:
  336. .sp
  337. If the first week of the period contains 4 or more \'work\'
  338. days, it is included in the period; otherwise, the first
  339. week was included in the prior period\.
  340. .sp
  341. If the last week of the period contains 4 or more \'work\'
  342. days it is included in the period; otherwise, the last week
  343. is included in the next period\.  This results in 13 week
  344. \'quarters\' and 4 or 5 week \'months\'\.  Every 5 or 6 years, a
  345. \'quarter\' will contain 14 weeks and the year will contain 53
  346. weeks\.
  347. .sp
  348. .in 0.08i
  349. \fBExamples
  350. .sp
  351. .in 0.4i
  352. .br
  353. // get info about accounting month containing 9/15/90
  354. .br
  355. aDateInfo := FT_ACCTQTR( CTOD("09/15/90") )
  356. .ta 1.36i 1.68i 2.72i
  357. .br
  358. ? aDateInfo[1]    //    199003    (3rd quarter)
  359. .br
  360. .ta
  361. .ta 1.36i 1.68i 2.72i
  362. .br
  363. ? aDateInfo[2]    //    07/01/90    beginning of quarter 3
  364. .br
  365. .ta
  366. .ta 1.36i 1.68i 2.72i
  367. .br
  368. ? aDateInfo[3]    //    09/29/90    end of quarter 3
  369. .br
  370. .ta
  371. .sp
  372. .br
  373. // get info about accounting qtr\. 2 in year containing 9/15/90
  374. .br
  375. aDateInfo := FT_ACCTQTR( CTOD("09/15/90"), 2 )
  376. .ta 1.36i 1.68i
  377. .br
  378. ? aDateInfo[1]    //    199002
  379. .br
  380. .ta
  381. .ta 1.36i 1.68i 2.56i
  382. .br
  383. ? aDateInfo[2]    //    04/01/89    beginning of quarter 2
  384. .br
  385. .ta
  386. .ta 1.36i 1.68i 2.56i
  387. .br
  388. ? aDateInfo[3]    //    06/30/90    end of quarter 2
  389. .br
  390. .ta
  391. .sp
  392. .in 0.08i
  393. \fBSource:\fR ACCTQTR\.PRG
  394. .sp
  395. \fBAuthor:\fR Jo W\. French dba Practical Computing
  396. .in 0i
  397. .sp
  398. .in 1.5i
  399. .ti -1.5i
  400. .ta 1.5i
  401. .ft B
  402. See Also:    
  403. .ft R
  404. FT_DATECNFG()
  405. , FT_ACCTWEEK()
  406. , FT_ACCTMONTH()
  407. , FT_ACCTYEAR()
  408. .ta 1.63265i
  409. .in 0i
  410. .sp 2
  411. .ne 20
  412. .ps +3
  413. .vs +3
  414. FT_ACCTWEEK()    Return accounting week data
  415. .br
  416. .ta
  417. .in 0.08i
  418. .ps -3
  419. .vs -3
  420. .sp 2
  421. \fBFT_ACCTWEEK()
  422. Return accounting week data
  423. .in 0i
  424. .br
  425. \l'6.24i'
  426. .br
  427. .sp
  428. .in 0.08i
  429. \fBSyntax
  430. .sp
  431. .in 0.4i
  432. \fBFT_ACCTWEEK( [ <dGivenDate> ], [ <nWeekNum> ] ) -> aDateInfo
  433. .sp
  434. .in 0.08i
  435. \fBArguments
  436. .sp
  437. .in 0.4i
  438. \fB<dGivenDate>\fR is any valid date in any date format\.  Defaults
  439. to current system date if not supplied\.
  440. .sp
  441. \fB<nWeekNum>\fR is a number from 1 to 52 signifying a week\.
  442. Defaults to current week if not supplied\.
  443. .sp
  444. .in 0.08i
  445. \fBReturns
  446. .sp
  447. .in 0.4i
  448. A three element array containing the following data:
  449. .sp
  450. .in 0.64i
  451. .br
  452. aDateInfo[1] - The year and week as a character string "YYYYWW"
  453. .br
  454. aDateInfo[2] - The beginning date of the accounting week
  455. .br
  456. aDateInfo[3] - The ending date of the accounting week
  457. .sp
  458. .in 0.08i
  459. \fBDescription
  460. .sp
  461. .in 0.4i
  462. FT_ACCTWEEK() returns an arr